package com.lg.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @author by Mr. Li 2020/9/7 23:06
 */
@Repository
public class UserDao {

    @Autowired
    private JdbcTemplate jdbcTemplate;


    public void add(int id, String name, Integer age) {
        String sql = "INSERT INTO test1(id,name,age) VALUES(?,?,?);";
        int updateResult = jdbcTemplate.update(sql, id, name, age);
        System.out.println("updateResult:" + updateResult);
    }

}
